<?php
/***************************************************************
*  Copyright notice
*  (c) 2009, jianyuzhu@gmail.com
*  All rights reserved
*  This script is part of the PPEMI project.
***************************************************************/

//
require(dirname(dirname(__FILE__)) . '/includes/application_top.php');

//
include_once(CONFIG_PATH . CONFIG_DIR_CLASSES . 'core.directory.class.php');

//
$dObj = new CoreDirectoryParser(CONFIG_PATH . 'var/cache/pagecache/');
$dObj->parse();
$_dir = $dObj->_dir;
$dirs = $dObj->getDirs();
$files = $dObj->getFiles();
//
if( is_array($files) ) {
	//
	foreach($files as $key => $file) {
		//if( strstr($file['file'], 'xxx') === false ) {
			@unlink($_dir . $file['file']);
		//}
	}
	//
	foreach($dirs as $key => $value) {
		util_rmdir($_dir . $value);
	}
}
//
echo 'OK';
//
?>